class GroupPartecipationRequest < ActiveRecord::Base
  belongs_to :user, :class_name => 'User', :foreign_key => :user_id
  #has_one :partecipation_role, :class_name => 'PartecipationRole', :foreign_key => :partecipation_role_id
  belongs_to :group, :class_name => 'Group', :foreign_key => :group_id
  belongs_to :status, :class_name => 'GroupPartecipationRequestStatus', :foreign_key => :group_partecipation_request_status_id
  
  named_scope :pending, { :conditions => {:group_partecipation_request_status_id => 1 }}
  named_scope :voting, { :conditions => {:group_partecipation_request_status_id => 2 }}
end
